package com.victor.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 时间相关工具类
 * 
 * @author Mr.Zhang
 *
 */
public class DateUtils {
	// 获取当前日期
	public static String getNowDate() {
		Date d = new Date();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		String dateNowStr = sdf.format(d);
		return dateNowStr;
	}

	// 获取当前时间
	public static String getNowTime() {
		Date d = new Date();
		SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
		String dateNowStr = sdf.format(d);
		return dateNowStr;
	}
	
	public static void main(String[] args) {
		System.out.println(getNowDate());
		System.out.println(getNowTime());
	}
}
